<!DOCTYPE html>
    <html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="UTF-8">
        <title>spider</title>
        <link rel="stylesheet" href="/static/layui/css/layui.css"
              th:href="@{/static/layui/css/layui.css}">
    </head>
    <style>
        #cot{
            margin-top: 50px;
            margin-left: 320px;
        }
        #url{
            text-indent: 60px;
            width: 500px;
        }
        #updFic{
            text-indent: 60px;
            width: 504px;
            height: 21px;
        }
        .h20-blank{
            height: 20px;
        }
    </style>
    <body>
        <div id="cot">
            <form action="#" th:action="@{/webSpider/writeOne}" method="post">
                <input id="url" type="text" name="url" placeholder="请输入待爬取小说首页url">
                <input type="submit" onclick="return sub1()" value="爬取小说">
            </form>
            <div class="h20-blank"></div>
            <form action="#" th:action="@{/webSpider/updateFic}" method="post">
<!--                <input id="updFic" type="text" name="url" placeholder="请输入已入库小说首页url">-->
                <select id="updFic" name="url" required>
                    <option value="">--选择需要更新的小说--</option>
                    <option th:each="item:${list}" th:value="${item.url}" th:text="${item.bookName}"></option>
                </select>
                <input type="submit" value="更新小说">
            </form>
            <a href="https://www.81zw.com/book/72371/" target="_blank">
                <span>url示例：</span>
                <em>https://www.81zw.com/book/72371/</em>
            </a>
        </div>
    </body>
    <script src="/static/js/jquery-3.7.0.js" th:src="@{/static/js/jquery-3.7.0.js}"></script>
    <script th:inline="javascript">
        let preUrl = "https://www.81zw.com/book/";
        function sub1(){
            let url = $('#url').val();
            if (url==null||url.substring(0, 26) !== preUrl) {
                alert("请输入符合要求的url，目前仅支持81中文网的小说源哦");
                return false;
            }
            return true;
        }
    </script>
</html>